import QtQuick
import QtQuick.Controls

Rectangle {
    width: 400
    height: 400

    AnimatedImage {
        id: behaviorImg
        source: "qrc:/images/huaji.gif"
        x: 150
        y: 150
        width: 100
        height: 100

        // 默认行为动画
        Behavior on x {
            NumberAnimation {
                duration: 500
                easing.type: Easing.OutBounce
            }
        }
    }

    Row {
        anchors.bottom: parent.bottom
        spacing: 10
        Button {
            text: "左移50"
            onClicked: behaviorImg.x -= 50
        }

        Button {
            text: "右移50"
            anchors.bottom: parent.bottom
            onClicked: behaviorImg.x += 50
        }
    }
}
